package weifei.live.simulation.im.cmd;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;


@Data
public class Result
{
    public enum Type
    {
        Data,                       // 数据
        Notice,                     // 给 客户端 的通知
        Message,                    // 消息
        GroupLiveStreamBullet,      // 群聊直播间 弹幕
    }


    private final Result.Type type;
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private final java.util.Date time = new java.util.Date();
    private final Object data;


    private Result(Result.Type type, Object data)
    {
        this.type = type;
        this.data = data;
    }



    public static Result data(Object data) { return new Result(Type.Data, data); }
    public static Result notice(Notice notice) { return new Result(Type.Notice, notice); }
    public static Result message(Message message)
    {
        return new Result(Type.Message, message);
    }
    public static Result groupLiveStreamBullet(Bullet bullet) { return new Result(Type.GroupLiveStreamBullet, bullet); }

}






